<?php

namespace App\Console\Commands\Wanggui;

use App\Console\Commands\Traits\ExcelCommandTrait;
use App\Service\Wanggui\Import\RecommendFloorData;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Console\Command;

class ImportRecommendFloorData extends Command
{

    use ExcelCommandTrait;

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'wanggui:import-recommend-floor-data';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '导入推荐楼层数据';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @throws GuzzleException
     */
    public function handle()
    {
        $defaultUrl = 'https://file.51kuafu.com/13/d8/f2f658facef02e2a3153d6741d23973636e4e728902d59e2fad8b113a615.csv';

        $this->setInputExcel(false)->excelImport(RecommendFloorData::class, $defaultUrl);
    }
}
